﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="Referent_Sender.aspx.cs" Inherits="UdrinkWater_Project.Officer.Referent_Sender" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    
    <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" 
        HeaderText="รายละเอียดการค้างชำระ" Width="100%">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
    <dx:ASPxGridView ID="GV_UnpaidConfirm" runat="server" 
        AutoGenerateColumns="False" DataSourceID="SqlData_ListUnpaid" 
        KeyFieldName="Unpaid_Date" Width="100%">
        <Columns>
            <dx:GridViewDataDateColumn FieldName="Unpaid_Date" ReadOnly="True" 
                ShowInCustomizationForm="True" Visible="False" VisibleIndex="0">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn Caption="ชื่อ - นามสกุล" FieldName="Name" 
                ShowInCustomizationForm="True" VisibleIndex="1">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="ที่อยู่" FieldName="Address" 
                ShowInCustomizationForm="True" VisibleIndex="2">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Caption="ตำบล" FieldName="District_ID" 
                ShowInCustomizationForm="True" VisibleIndex="3">
                <PropertiesComboBox DataSourceID="SqlData_District" TextField="DISTRICT_NAME" 
                    ValueField="DISTRICT_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Caption="อำเภอ" FieldName="Aumphur_ID" 
                ShowInCustomizationForm="True" VisibleIndex="4">
                <PropertiesComboBox DataSourceID="SqlData_Aumphur" TextField="AMPHUR_NAME" 
                    ValueField="AMPHUR_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Caption="จังหวัด" FieldName="Province_ID" 
                ShowInCustomizationForm="True" VisibleIndex="5">
                <PropertiesComboBox DataSourceID="SqlData_Province" TextField="PROVINCE_NAME" 
                    ValueField="PROVINCE_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn Caption="จำนวนเงิน" FieldName="Count" 
                ShowInCustomizationForm="True" VisibleIndex="6">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn Caption="วันกำหนดชำระ" 
                FieldName="UnpaidDeadline_Date" ShowInCustomizationForm="True" VisibleIndex="7">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn Caption="ผู้ทำรายการ" FieldName="Act_Officer" 
                ShowInCustomizationForm="True" Visible="False" VisibleIndex="8">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Caption="สถานะการชำระ" FieldName="Status_Unpaid" 
                ShowInCustomizationForm="True" VisibleIndex="9">
                <PropertiesComboBox DataSourceID="SqlData_Status_Unpaid" 
                    TextField="Unpaid_Name" ValueField="Unpaid_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn Caption="เอกสารอ้างอิง" FieldName="Referent_Unpaid" 
                ShowInCustomizationForm="True" VisibleIndex="10">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn ShowInCustomizationForm="True" Visible="False" 
                VisibleIndex="11">
                <DataItemTemplate>
                    <dx:ASPxCheckBox ID="CheckBox1" runat="server" Text="ยืนยันการชำระเงิน">
                    </dx:ASPxCheckBox>
                </DataItemTemplate>
            </dx:GridViewDataTextColumn>
        </Columns>
        <SettingsPager Mode="ShowAllRecords">
        </SettingsPager>
    </dx:ASPxGridView>
    <div align="center">
        <dx:ASPxButton ID="bt_Cancle" runat="server" Text=" ยกเลิก" 
            OnClick="bt_Cancle_Click">
        </dx:ASPxButton>
    </div>
    <asp:SqlDataSource ID="SqlData_ListUnpaid" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT Unpaid_Date, Name, Address, District_ID, Aumphur_ID, Province_ID, Count, UnpaidDeadline_Date, Act_Officer, Status_Unpaid, Referent_Unpaid FROM TB_unpaid WHERE Unpaid_Date=@Unpaid_Date">
        <SelectParameters>
            <asp:SessionParameter Name="Unpaid_Date" SessionField="Unpaid" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_District" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_District]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Aumphur" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Aumphur]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Province" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Province]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlData_Status_Unpaid" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_StatusUnpaid]"></asp:SqlDataSource>
            </dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
    
</asp:Content>
